﻿/// <reference path="../scripts/jquery-1.11.2.min.js" />
/// <reference path="../scripts/bootstrap.min.js" />

if (typeof ($) != "undefined" && $) {
    //验证用户
    CheckUser();
    $(document).ready(onReady);

}

function onReady() {
    var ua = navigator.userAgent.toLowerCase();
    var isIos = (ua.indexOf('iphone') != -1) || (ua.indexOf('ipad') != -1);

    $.ajax({
        type: "get",
        url: "api/member.ashx?ac=info&k=" + Math.random(),
        beforeSend: function () {
            $('#loadingToast').show();
        },
        error: function () {
            showToast("获取用户信息失败");
        },
        success: function (data) {
            if (data != null && data != '') {
                var m = eval("(" + data + ")");
                $("#mobile").html(m.Mobile);
                $("#mycode").html(m.Mobile);
                $("#servicetime").html(m.ServiceTime);
                if (m.TrueName != null && m.TrueName != '') {
                    $("#truename").html(m.TrueName);
                }
                else {
                    $("#truename").html('点击设置');
                }
            }
        },
        complete: function () {
            $('#loadingToast').hide();
        }
    });

    $("#divhead").click(function () {
        window.location.href = 'myinfo.html';
    });
    $("#versions").click(function () {
        window.location.href = 'img.aspx';
    });
    
}

